<template>
	<view class="content">
		<view class="list">
			<view class="card" v-for="(item,index) in list" @click="jump(item.url)">
				<img :src="item.img" alt="" />
				<p>{{item.title}}</p>
			</view>
		<!-- 	<view class="card"  @click="wannianli()">
				<img src="../../static/image/huangli.jpg" alt="" />
				<p>万年历/黄历</p>
			</view>
			<view class="card"  @click="xmscq()">
				<img src="../../static/image/qiming.png" alt="" />
				<p>智能起名</p>
			</view>
			<view class="card"  @click="zidianchaxun()">
				<img src="../../static/image/zidian.png" alt="" />
				<p>起名用字</p>
			</view>
			<view class="card" v-if="isShowTop==0"  @click="shengchenbazi()">
				<img src="../../static/image/wuxing.png" alt="" />
				<p>四柱生辰八字查询</p>
			</view>
			<view class="card"  @click="xingzuopeidui()">
				<img src="../../static/image/xzpp.png" alt="" />
				<p>星座配对</p>
			</view>
			<view class="card"  v-if="isShowTop==0"  @click="qigua()">
				<img src="../../static/image/bagua1.png" alt="" />
				<p>小六壬时辰起卦</p>
			</view>
			<view class="card" v-if="isShowTop==0"  @click="xzxz()">
				<img src="../../static/image/xingzuo3.png" alt="" />
				<p>今日星座运势</p>
			</view>
			<view class="card" v-if="isShowTop==0"  @click="chepai()">
				<img src="../../static/image/chepai.png" alt="" />
				<p>车牌凶吉查询</p>
			</view>
			<view class="card"  v-if="isShowTop==0"  @click="zgsg()">
				<img src="../../static/image/zgsg.png" alt="" />
				<p>诸葛神算随机抽卦</p>
			</view>
			<view class="card"  @click="leinuopai()">
				<img src="../../static/image/33.png" alt="" />
				<p>雷诺曼随机抽牌占卜</p>
			</view>
			<view class="card"  @click="chouqian()">
				<img src="../../static/image/zxcq.png" alt="" />
				<p>诸葛神数签诗</p>
			</view> -->
			
			<view class="card"  @click="xueshici()">
				<img src="../../static/image/xueshici.png" alt="" />
				<p>学诗词</p>
			</view>
			<view class="card"  @click="caijian()">
				<img src="../../static/image/caijian.png" alt="" />
				<p>创意切图</p>
			</view>
		<!-- 	
			<view class="card"  @click="suijiyulu()">
				<img src="../../static/image/sjyl.png" alt="" />
				<p>随机语录</p>
			</view> -->

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				isShowTop:0,
				list:[],
			}
		},
		onLoad() {

       // this.geuTuiguang()
		},
		onShow() {
			this.getData()
		},
		onShareAppMessage(res) {
			wx.showShareMenu({
				withShareTicket: true,
				menus: ['shareAppMessage', 'shareTimeline']
			})
			return {
				title: "看看你今天的星座运势吧",
				imageUrl: "https://www.leedong.top/img/suangua1.jpg"
			}

		},
		//2.分享到朋友圈
		onShareTimeline() {

			return {
				title: '看看你今天的星座运势吧',
				imageUrl: "https://www.leedong.top/img/suangua1.jpg",


			}
		},
		methods: {
			// geuTuiguang() {
			// 	this.$api.tuiguang().then((res) => {
			// 		console.log(res)
			// 		this.isShowTop = res.rows[0].name;
			// 	})
			// },
			// chepai(){
			// 	uni.navigateTo({
			// 		url: `/pages/chepai/chepai`
			// 	})
			// },
			caijian(){
				uni.navigateToMiniProgram({
				    appId: 'wx7a3937078e3f2f8b',
				    path: '/pages/index/index',
				    //develop开发版；trial体验版；release正式版
				    envVersion: 'release', 
				    success(res) {
				      // 打开成功
				      console.log("跳转小程序成功！",res);
				    } 
				})
			},
			xueshici(){
				uni.navigateToMiniProgram({
				    appId: 'wx331c15a9eda0fe71',
				    path: '/pages/index/index',
				    //develop开发版；trial体验版；release正式版
				    envVersion: 'release', 
				    success(res) {
				      // 打开成功
				      console.log("跳转小程序成功！",res);
				    } 
				})
			},
			// bazihehun(){
			// 	uni.navigateTo({
			// 		url: `/pages/bazihehun/bazihehun`
			// 	})
			// },
			// wannianli(){
			// 	uni.navigateTo({
			// 		url: `/pages/wannianli/wannianli`
			// 	})
			// },
			// xmscq(){
			// 	uni.navigateTo({
			// 		url: `/pages/xmscq/xmscq`
			// 	})
			// },
			// zidianchaxun(){
			// 	uni.navigateTo({
			// 		url: `/pages/zidianchaxun/zidianchaxun`
			// 	})
			// },
			// shengchenbazi(){
			// 	uni.navigateTo({
			// 		url: `/pages/shengchenbazi/shengchenbazi`
			// 	})
			// },
			// xingzuopeidui(){
			// 	uni.navigateTo({
			// 		url: `/pages/xingzuopeidui/xingzuopeidui`
			// 	})
			// },
			// qigua(){
			// 	uni.navigateTo({
			// 		url: `/pages/qigua/qigua`
			// 	})
			// },
			// suijiyulu(){
			// 	uni.navigateTo({
			// 		url: `/pages/suijiyulu/suijiyulu`
			// 	})
			// },
			// xzxz(){
			// 	uni.navigateTo({
			// 		url: `/pages/xzxz/xzxz`
			// 	})
			// },
			// zgsg(){
			// 	uni.navigateTo({
			// 		url: `/pages/zgsg/zgsg`
			// 	})
			// },
			// leinuopai(){
			// 	uni.navigateTo({
			// 		url: `/pages/leinuopai/leinuopai`
			// 	})
			// },
			// chouqian(){
			// 	uni.navigateTo({
			// 		url: `/pages/chouqian/chouqian`
			// 	})
			// },
			jump(item){
				uni.navigateTo({
					url: `/pages/${item}/${item}`
				})
			},
			getData(){
				this.$api.urls().then(res=>{
				
				
					let data=res.rows;
					this.list=data.filter((item)=>{
						return item.show==0;
					})
					this.list=this.list.reverse()
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f4f1ec;
	}

	.list {
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;
		padding: 20px;


		.card {
			box-shadow: rgba(0, 0, 0, 0.15) 0px 2px 8px;
			width: 30%;
			text-align: center;
			margin-top: 30px;
			background-color: #fff;
			border-radius: 15px;
			min-height: 210rpx;
			align-items: center;


			img {
				width: 60px;
				height: 60px;
				margin-top: 10px;
				border-radius: 35px;
			}
		}

	}
</style>